package com.jwcao.common.cast.operation.access.field;

import com.jwcao.common.cast.operation.access.AccessOperation;
import com.jwcao.common.scan.object.ScanField;
import org.apache.commons.lang3.StringUtils;

/**
 * name: FieldAccessOperation description: TODO
 *
 * @author caojingwei date: 2023/3/25 11:48
 */
public abstract class FieldAccessOperation extends AccessOperation {

    protected final ScanField sourceField;

    public boolean judgeInjectMethodParameter(String name) {
        return StringUtils.equals(sourceField.getName(), name);
    }

    public FieldAccessOperation(ScanField targetField, ScanField sourceField) {
        super(targetField);
        this.sourceField = sourceField;
    }
}
